{% extends "_layouts/default.html" %}
{% block content %}
<div class="tabs_title clearfix">
  <h3>友情链接管理</h3>

<ul>
<li class="current"><a href="/admin/link"><span>友情链接列表</span></a></li>
<li><a href="/admin/link/edit"><span>添加</span></a></li>
</ul>

</div>
<div class="block tips">
    <h3>搜索友情链接</h3>
    <form class="adminform" method="get" action="/admin/link">
        <table class="maintable" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td>
            <select name="ischeck" id="ischeck">
            	<option value="" >所有</option>
                <option value="1" {% if ctx.ischeck=="1" %}selected="selected"{% endif %}>已通过</option>
                <option value="0" {% if ctx.ischeck=="0" %}selected="selected"{% endif %}>待审核</option>
           </select>
名称:
<input type="text" name="name" class="txt" value="{{ ctx.name }}" id="name" />
                <input type="submit" value="搜索" class="btn" /></td>
            </tr>
        </table>
    </form>
</div>
<div class="block tips">
    <h3>友情链接列表</h3>
    <form method="post" action="<?php echo url('link/update',$formparams); ?>" class="adminform" name="deleteform">
        <table  border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="3%"><input type="checkbox" class="checkbox" onclick="$('input[name=\'lid[]\']').attr('checked', this.checked);" title="全选/取消全选" /></td>
                <td width="7%">序号</td>
                <td width="15%">名称</td>
                <td width="20%">链接地址</td>
                <td width="17%">添加时间</td>
                <td width="10%">状态</td>
                <td width="15%">操作</td>
            </tr>{% for link in links['list']  %}
            <tr>
                <td><input type="checkbox" name="lid[]" value="<?php echo $link->lid; ?>" class="checkbox" /></td>
                <td>{{link.lid}}</td>
                 <td>{{ link.name }}</td>
                <td><a target="_blank" href="{{ link.url }}">{{ link.url }}</a></td>
                <td>{{ link.ctime }}</td>
                <td>{% if link.ischeck %}已通过{% else %}待审核{% endif %}</td>
                <td><a href="link/edit?lid={{link.lid}}" target="_self" >修改/审核</a> </td>
            </tr>
            {% endfor %}
            <tr class="nobg">
                <td>
                    <input type="checkbox" name="chkall" id="chkall" class="checkbox" onclick="$('input[name=\'lid[]\']').attr('checked', this.checked);" />

                </td>
                <td >
                    <input type="submit" class="btn" name="btnsubmit" onclick="return confirm('确定要删除吗？')" value="删除"  />

                </td>
                <td><a href="link/edit">添加友情链接</a></td>
                <td colspan="5"><div class="cuspages right">{{ links['pagination'].render() }}</div></td>
            </tr>
        </table>
    </form>
</div>
{% endblock %}